<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>

    <script src="${pageContext.request.contextPath}/js/jquery-2.1.0.js" type="text/javascript"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/index.less.css">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />

    <title>首页</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            text-decoration: none;
            list-style: none;
        }
        .site-nav {
            z-index: 10000;
            width: 100%;
            background-color: #e4e4e4;
            border-bottom: 1px solid #eee;
            overflow: visible;
            position: fixed;
            left: 0px;
            top: 0px;
        }
        .site-nav div {
            margin: 0 auto;
            width: 1190px;
            height: 35px;
            background-color: #e4e4e4;
            z-index: 10002;
            position: relative;
            padding: 0 6px;
            line-height: 35px;
        }

        .site-nav div a {
            float: left;
            margin-right: 7px;
            font-size: 12px;
            color: #6C6C6C;
        }

        .head-wrap {
            padding-top: 36px;
            background-color: #fff;
            z-index: 100;
            /* border-bottom: 1px #e5e5e5 solid; */
        }

        .center-wrap {
            display: block;
            height: 72px;
            width: 990px;
            min-width: 990px;
            margin: 0 auto;
        }

        .nav-wrap {
            float: left;
        }

        .nav-wrap .nav {
            float: left;
            padding-top: 18px;
            display: block;
            margin-block-start: 1em;
            margin-block-end: 1em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            padding-inline-start: 40px;
        }
        .nav li:first-child a{
            border-bottom: 3px #eb002a solid;
            color: #eb002a;
        }
        .nav li {
            float: left;
            color: #6b6b6b;
            line-height: 42px;
            width: 74px;
            height: 44px;
        }

        .nav li a {
            color: #666;
            font-size: 18px;
            float: left;
            padding: 0 14px;
            margin-right: 10px;
        }
        .tab-movie-tit a {
            display: block;
            margin-right: 30px;
            float: left;
            color: #999;
            font-size: 16px;
            margin-top: 32px;
            line-height: 26px;
            text-decoration: none;
        }

        .tab-movie-tit a.current {
            color: #3e3e3e;
            border-bottom: 2px #eb002a solid;
        }
        .hover {
            transform: translateZ(0);
            position: relative;
            z-index: 100000;
            display: none;
            /* width: 330px;
            height: 100px; */
            float: left;
            margin-left: 170px;
        }

        .hover a {
            color: #000;
        }
    </style>
</head>

<body>

    <c:import url="head.jsp" charEncoding="UTF-8" />



    <div style="width: 100%; height: 360px;background-color: #333; margin-top: 20px;">
        <div class="container" style="padding: 0px; height: 360px;">
            <div id="myCarousel" class="carousel slide" style="height: 360px;">
                <!-- 轮播（Carousel）指标 -->
                <ol class="carousel-indicators">
                    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                    <li data-target="#myCarousel" data-slide-to="1"></li>
                    <li data-target="#myCarousel" data-slide-to="2"></li>
                </ol>
                <!-- 轮播（Carousel）项目 -->
                <div class="carousel-inner" style="height: 360px;">
                    <div class="item active" style="height: 360px;">
                        <a href="filma?filmId=2"><img src="${pageContext.request.contextPath}/imgs/812902834.jpg" alt="First slide"></a>
                    </div>
                    <div class="item" style="height: 360px;">
                        <a href="filma?filmId=1"><img src="${pageContext.request.contextPath}/imgs/1358153836..jpg" width="100%"></a>
                    </div>
                    <div class="item" style="height: 360px;">
                        <a href="filma?filmId=4"><img src="${pageContext.request.contextPath}/imgs/2132470991.jpg" alt="Third slide"></a>
                    </div>
                </div>
                <!-- 轮播（Carousel）导航 -->
                <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>

    </div>

    <div class="center-wrap" data-spm="w2">
        <div class="tab-control tab-movie-tit">
            <a class="tab-control-item current" id="re" href="#">正在热映</a>
            <a class="tab-control-item " id="shang" href="#">即将上映</a>
            <a class="more" href="/home">查看全部&nbsp;&gt;</a>
        </div>

        <div class="tab-content">
            <!-- 正在热映 -->
            <div class="tab-movie-list" style="display: block;">
                    <c:forEach items="${filmListTop4}" var="listTop">
                    <div class="movie-card-wrap">
                        <a href="filmInfo?filmId=${listTop.f_id}" class="movie-card">
                            <div class="movie-card-poster">
                                <img width="160" height="224"
                                     src="${pageContext.request.contextPath}${listTop.img_path}">
                            </div>
                            <div class="movie-card-name">
                                <span class="bt-l">${listTop.f_name}</span>
                                <span class="bt-r">9.3</span>
                            </div>
                            <div class="movie-card-info">
                                <div class="movie-card-mask"></div>
                                <div class="movie-card-list">
                                    <span>导演：${listTop.f_director}</span>
                                    <span>主演：${listTop.f_players}</span>
                                    <span>类型：${listTop.f_type}</span>
                                    <span>地区：${listTop.f_country}</span>
                                    <span>语言：汉语普通话</span>
                                    <span>片长：${listTop.f_length}分钟</span>
                                </div>
                            </div>
                        </a>
                        <a href="filmInfo?filmId=${listTop.f_id}" class="movie-card-buy" style="width: 220px;">选座购票</a>
                    </div>
                    </c:forEach>
            </div>

            <!-- 即将热映 -->
            <div class="tab-movie-list">
                <c:forEach items="${filmListSoon}" var="listSoon">
                <div class="movie-card-wrap">
                    <a href="filmSoon?filmId=${listSoon.f_id}" class="movie-card">
                        <div class="movie-card-tag"><i class="t-"></i></div>
                        <div class="movie-card-poster">
                            <img width="160" height="224"
                                 src="${pageContext.request.contextPath}${listSoon.img_path}">
                        </div>
                        <div class="movie-card-name">
                            <span class="bt-l">${listSoon.f_name}</span>
                            <span class="bt-r"></span>
                        </div>
                        <div class="movie-card-info">
                            <div class="movie-card-mask"></div>
                            <div class="movie-card-list">
                                <span>导演：${listSoon.f_director}</span>
                                <span>主演：${listSoon.f_players}</span>
                                <span>类型：${listSoon.f_type}</span>
                                <span>地区：${listSoon.f_country}</span>
                                <span>语言：汉语普通话</span>
                                <span>片长：${listSoon.f_length}</span>
                            </div>
                        </div>
                    </a>
                    <a href="filmSoon?filmId=${listSoon.f_id}" class="movie-card-soon">上映时间<fmt:formatDate value="${listSoon.f_time}" pattern="yyyy-MM-dd"/></a>
                </div>
                </c:forEach>
            </div>
        </div>

    </div>

    <script type="text/javascript">
        console.log("${pageContext.request.contextPath}")
        $(function () {
            $(".tab-movie-tit").on("click", "a", function () {
                if ($(this).hasClass("current")) {

                } else {
                    $(".tab-control-item").removeClass("current");
                    $(this).addClass("current");
                    if ($(this).attr("id") == "re") {
                        $(".tab-movie-list:eq(1)").removeAttr("style");
                        $(".tab-movie-list:eq(0)").attr("style", "display: block;");
                    } else {
                        $(".tab-movie-list:eq(0)").removeAttr("style");
                        $(".tab-movie-list:eq(1)").attr("style", "display: block;");
                    }

                }
            })
        })
    </script>

</body>

</html>